package cn.drew.org.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department {

    private Long id;
    private String sn;
    private String name;
    private String dirPath;
    private Integer state;
    private Long managerId;
    private Long parentId;

//    private List<Department> children =new ArrayList<>();

    // 无限级数
    //如果给属性赋值,会出现 没有下级时也会展示下拉框的空集合
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Department> children = new ArrayList<>();

    // 负责人
    private Employee manager;

    // 上级部门
    private Department parent;
}
